using System;
using System.ComponentModel;
using System.Transactions;

using SIS.ENT;
using SIS.DAL;


namespace SIS.BLL {

/// <summary>
/// The StandarLevelClassRoomLocationTableManager class is responsible for managing BO.StandarLevelClassRoomLocationTable objects in the system.
/// </summary>
[DataObjectAttribute()]
public class StandarLevelClassRoomLocationTableManager
  {

#region "Public Methods"

/// <summary>
/// Gets a list with all StandarLevelClassRoomLocationTable objects in the database.
/// </summary>
/// <returns>A list with all StandarLevelClassRoomLocationTable from the database when the database contains any, or null otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, true)]
public static StandarLevelClassRoomLocationTableList GetList(){
return StandarLevelClassRoomLocationTableDB.GetList();
}

/// <summary>
/// Gets a single StandarLevelClassRoomLocationTable from the database without its data.
/// </summary>
/// <param name="standarLevelKey">The StandarLevelKey of the StandarLevelClassRoomLocationTable in the database.</param>
/// <returns>A StandarLevelClassRoomLocationTable object when the StandarLevelKey exists in the database, or <see langword="null"/> otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static StandarLevelClassRoomLocationTable GetItem(int standarLevelKey){
return GetItem(standarLevelKey, false);
}

/// <summary>
/// Gets a single StandarLevelClassRoomLocationTable from the database.
/// </summary>
/// <param name="standarLevelKey">The StandarLevelKey of the StandarLevelClassRoomLocationTable in the database.</param>
/// <param name="getStandarLevelClassRoomLocationTableRecords">Determines whether to load all associated StandarLevelClassRoomLocationTable records as well.</param>
/// <returns>
/// A StandarLevelClassRoomLocationTable object when the StandarLevelKey exists in the database, or <see langword="null"/> otherwise.
/// </returns>
[DataObjectMethod(DataObjectMethodType.Select, false)]
public static StandarLevelClassRoomLocationTable GetItem(int standarLevelKey, bool getStandarLevelClassRoomLocationTableRecords){
StandarLevelClassRoomLocationTable myStandarLevelClassRoomLocationTable = StandarLevelClassRoomLocationTableDB.GetItem(standarLevelKey);
return myStandarLevelClassRoomLocationTable;
}

/// <summary>
/// Saves a StandarLevelClassRoomLocationTable in the database.
/// </summary>
/// <param name="myStandarLevelClassRoomLocationTable">The StandarLevelClassRoomLocationTable instance to save.</param>
/// <returns>The new StandarLevelKey if the StandarLevelClassRoomLocationTable is new in the database or the existing StandarLevelKey when an item was updated.</returns>
[DataObjectMethod(DataObjectMethodType.Update, true)]
public static int Save(StandarLevelClassRoomLocationTable myStandarLevelClassRoomLocationTable){
using (TransactionScope myTransactionScope = new TransactionScope()){
int standarLevelClassRoomLocationTableStandarLevelKey = StandarLevelClassRoomLocationTableDB.Save(myStandarLevelClassRoomLocationTable);

//  Assign the StandarLevelClassRoomLocationTable its new (or existing StandarLevelKey).
myStandarLevelClassRoomLocationTable.StandarLevelKey = standarLevelClassRoomLocationTableStandarLevelKey;

myTransactionScope.Complete();

return standarLevelClassRoomLocationTableStandarLevelKey;
}
}

/// <summary>
/// Deletes a StandarLevelClassRoomLocationTable from the database.
/// </summary>
/// <param name="myStandarLevelClassRoomLocationTable">The StandarLevelClassRoomLocationTable instance to delete.</param>
/// <returns>Returns true when the object was deleted successfully, or false otherwise.</returns>
[DataObjectMethod(DataObjectMethodType.Delete, true)]
public static bool Delete(StandarLevelClassRoomLocationTable myStandarLevelClassRoomLocationTable){
return StandarLevelClassRoomLocationTableDB.Delete(myStandarLevelClassRoomLocationTable.StandarLevelKey);
}

#endregion

}

}
